Skip to content

feat(sentry): add transport push timeout config#1074

Merged
huangdijia merged 3 commits into
3.1from
sentry-transport-timeout
Jun 30, 2026
Merged

feat(sentry): add transport push timeout config#1074
huangdijia merged 3 commits into
3.1from
sentry-transport-timeout

Conversation

@huangdijia

Copy link
Copy Markdown
Contributor

Summary

  • Add sentry.transport_timeout configuration for Sentry coroutine transport.
  • Pass the configured timeout to channel push() when enqueueing events.

Changes

  • Publish SENTRY_TRANSPORT_TIMEOUT with default -1.
  • Store positive timeout values on CoHttpTransport and use them for channel push waits.

Test Plan

  • vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --dry-run --diff --ansi src/sentry/publish/sentry.php src/sentry/src/Transport/CoHttpTransport.php
  • vendor/bin/pest tests/Sentry

Risks

  • Low scope: affects Sentry coroutine transport enqueue behavior only when SENTRY_TRANSPORT_TIMEOUT is configured with a positive value.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b30d3542-d541-41f4-8e44-a5f454f71dab

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sentry-transport-timeout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@huangdijia huangdijia marked this pull request as ready for review June 30, 2026 08:43
@huangdijia huangdijia merged commit 7e0aee6 into 3.1 Jun 30, 2026
22 checks passed
@huangdijia huangdijia deleted the sentry-transport-timeout branch June 30, 2026 08:43
huangdijia added a commit that referenced this pull request Jun 30, 2026
* feat(sentry): add transport push timeout config

* format

* fix

---------

Co-Authored-By: Deeka Wong <8337659+huangdijia@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: df481587ec

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

$chan = $this->chan;
$chan?->push($event);
// push event to channel, if timeout is set, it will wait for the specified time
$chan?->push($event, $this->timeout);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return failure when enqueue times out

When sentry.transport_timeout is set to a positive value and the bounded transport channel stays full for that interval, Hyperf\Engine\Channel::push() returns false; this result is ignored here and send() still reports ResultStatus::success(). That means the new timeout path can silently drop Sentry events while the SDK/callers see a successful send, so the enqueue result should be checked and surfaced as a failed result or logged.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants